﻿<!--#include file="conn.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <link href="images/style.css" type="text/css" rel="stylesheet">
    <meta content="MSHTML 6.00.3790.0" name="GENERATOR">
</head>
<body style="font-size: 12px; v-text-align: center" leftmargin="0" topmargin="3"
    align="center" marginheight="0" marginwidth="0">
    <%if request("act")="del" then
conn.execute("delete from diqu where id in("&request("id")&")")
conn.close
set conn=nothing
response.redirect Request.ServerVariables("HTTP_REFERER")
response.end
end if%>
    <%if request("act")="save" then
id=request.form("id")
diqu=request.form("diqu")
filename=request.form("filename")
set rs=server.createobject("adodb.recordset")
if id<>"" then
sql="select * from diqu where id="&id
rs.open sql,conn,1,3
else
sql="select * from diqu"
rs.open sql,conn,1,3
rs.addnew
end if
rs("diqu")=trim(diqu)
rs("filename")=trim(filename)
rs.Update
rs.Close
set rs=nothing 
response.write("<script>alert('提交资料成功!');location='diqu_manage.asp'</script>")
response.end
end if
    %>
    <%if request("act")="modify" then
id=request.QueryString("id")
set rs=server.createobject("adodb.recordset")
sql="select * from diqu where id="&id
rs.open sql,conn,1,3
id=rs("id")
diqu=rs("diqu")
filename=rs("filename")
rs.close
end if
    %>
    <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#CCCCCC">
        <form name="form1" method="post" action="?act=save">
        <tr bgcolor="3972B4">
            <td colspan="2" bgcolor="e7e7e7">
                <div align="center">
                    <strong><font color="#000000">地区分类管理</font></strong></div>
            </td>
        </tr>
        <tr bgcolor="#CCCCCC">
            <td width="19%" bgcolor="#FFFFFF">
                <div align="right">
                    分类名称：</div>
            </td>
            <td width="81%" bgcolor="#FFFFFF">
                <input name="diqu" type="text" id="diqu" value="<%=diqu%>" size="20">
                <input name="id" type="hidden" id="id" value="<%=id%>" size="20">
            </td>
        </tr>
        <tr bgcolor="#CCCCCC">
            <td bgcolor="#FFFFFF">
                <div align="right">
                    文件名称：</div>
            </td>
            <td bgcolor="#FFFFFF">
                <input name="filename" type="text" id="filename" value="<%=filename%>" size="40">
            </td>
        </tr>
        <tr bgcolor="#CCCCCC">
            <td colspan="2" bgcolor="#FFFFFF">
                <div align="center">
                    <input type="submit" name="Submit" class="Submit" value="确定提交">
                </div>
            </td>
        </tr>
        </form>
    </table>
</body>
</html>
